<form name='dynamicselector' method='post' action='confirm_delete_badge.php' >
 <fieldset>
<?php
include(dirname(__FILE__) . "/connect.php");
include(dirname(__FILE__) . "/functions.php");
//$tablename = "saved_badge_id";

  $query="SELECT * FROM saved_badge_id ORDER BY `id` DESC ";
      $result = mysqli_query($con, $query) or die("query:" . mysql_error($con));
	  $num = mysqli_num_rows($result);

	  $i=0;
while ($i < $num) {

	$id = mysqli_result($result,$i,"id");
	$name= mysqli_result($result,$i,"name");
	$driver_id = mysqli_result($result,$i,"driver_id");
	$sta = mysqli_result($result,$i,"sta");
	$photo = mysqli_result($result,$i,"photo");
	$indie_con = mysqli_result($result,$i,"indie_con");
	$status = mysqli_result($result,$i,"status");
	$flag = mysqli_result($result,$i,"flag");					  
    $exp_date = mysqli_result($result,$i,"exp_date");
	$creation_date = mysqli_result($result,$i,"creation_date");

	  $badgedata = array($name,$driver_id,$sta,$photo,$indie_con,$status,$flag,$exp_date,$creation_date);
//	  $postbadgedata =  implode(',', $badgedata);
//	  $value = $name." :".$creation_date;
	  $value = $badgedata[0].':'.$badgedata[8];
		 
		 echo "<input type='checkbox' name='badge_name[]' value = $id />$value<br>";
 
$i++;
}
?>
<legend><input type="reset" value="Clear All">
<input type="submit" value="Delete">
</legend>
</fieldset>
</form>